<%@ include file="/jsp/include.jsp" %>

<%
String redirect = ParamUtil.getString(request, "redirect");
String backURL = ParamUtil.getString(request, "backURL", redirect);
%>

<portlet:actionURL var="formAction">
    <portlet:param name="action" value="updateCategory"/>
</portlet:actionURL>

<form:form action="${formAction}" commandName="category" name="editCategoryForm" method="post">
   <form:errors path="*" cssStyle="color:red"/>
	<liferay-util:include page="//jsp/category/toolbar.jsp" servletContext="<%=this.getServletContext() %>">
		<liferay-util:param name="toolbarItem" value="add"></liferay-util:param>
	</liferay-util:include>
	<form:hidden path="categoryId"/>
		<table class="lfr-table">
			<tr height="25">
		    	<td><liferay-ui:message key="Category.Name" /><liferay-ui:message key="autosoft_asteric" /></td>
		    	<td><form:input path="name" size="30" maxlength="128"/></td>
 			</tr>
 			<tr height="25">
		    	<td><liferay-ui:message key="Category.Description" /></td>
		    	<td><form:input path="description" size="100" maxlength="128"/></td>
 			</tr>
		</table>
	<div class="separator" ></div>
	<aui:button type="submit" value="Command.Save" /> 
	<%
		String taglibOnClick = "location.href = '" + HtmlUtil.escape(redirect) + "';";
	%>
	<aui:button type="button" value="Command.Cancel"  onClick="<%= taglibOnClick %>" />
</form:form>

<c:if test="<%= windowState.equals(WindowState.MAXIMIZED) %>">
	<aui:script>
		Liferay.Util.focusFormField(document.<portlet:namespace />fm.title);
	</aui:script>
</c:if>
